<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增-未定义</title>
    <link rel="stylesheet" th:href="@{/resources/bootstrap/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/resources/awi/css/font-awesome.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/resources/awi/css/AdminLTE.min.css}">
    <link rel="stylesheet" th:href="@{/resources/awi/css/skins/all-skins.min.css}">
    <link rel="stylesheet" th:href="@{/resources/plugins/ztree/css/zTreeStyle/zTreeStyle.css}">


</head>
<body>
<div class="container-fluid">
<div class="row">
    <div class="col-md-12">
        <div class="page-header">
            <h3>文件中心</h3>
        </div>
    </div>
</div>
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="box box-solid box-info">
                <div class="box-header">
                    新建文件夹
                </div>
                <div class="box-body">
                    <form role="form" method="post" action="/file/createFolder" id="folder-form">
                        <input type="hidden" name="createBy" value="">
                        <div class="form-group">
                            <label for="fileName">文件夹名 </label>
                            <input type="text"  id="fileName" name="fileName" class="form-control" placeholder="请填写文件夹名称" >
                        </div>

                        <div class="form-group">
                            <label for="parentName">上级文件夹 </label>
                            <input type="hidden"  id="parentId" name="parentId"  >
                            <input type="hidden" name="fileType" value="文件夹">
                            <input type="text" readonly id="parentName"  class="form-control" placeholder="点击选择上级文件夹" onclick="selectParent()" >
                        </div>

                        <div class="form-group">
                            <label for="fileName">备注说明 </label>
                            <textarea type="text"  id="remark" name="remark" class="form-control" placeholder="备注说明" >
                            </textarea>
                        </div>
                    </form>


                </div>
                <div class="box-footer">
                    <button type="button" id="submitBtn"  class="btn btn-primary pull-right" style="margin-left: 35px;" onclick="submitForm('#folder-form')">提交</button>
                    <button type="button" id="resetBtn" class="btn btn-warning pull-right" onclick="resetForm('#folder-form')">重置</button>
                </div>
            </div>


        </div>

    </div>

</div>
</body>
<!-- jQuery 2.2.3 -->
<script th:src="@{/resources/plugins/jQuery/jquery-2.2.3.min.js}"></script>
<!-- Bootstrap 3.3.6 -->
<script th:src="@{/resources/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/resources/layer/layer.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/resources/awi/js/app.js}"></script>
<!--tabs-->
<script th:src="@{/resources/awi/js/app_iframe.js}"></script>
<script th:src="@{/resources/commons/js/prototype.js}"></script>
<script th:src="@{/resources/plugins/ztree/js/jquery.ztree.all.js}"></script>
<script type="text/javascript">
    function selectParent() {
        layer.open({
            title:'新建目录',
            type: 1,
            area: ['320px', '440px'], //宽高
            content: '<div class="ztree" id="folderTree"></div>',
            btn:["确认"]
        });
        $.get("/file/listFolder",function(result){
            var setting = {
                data:
                    {
                        simpleData:
                            {
                                enable: true,
                                idKey: "id",
                                pIdKey: "pId",
                                rootPId: 0
                            }
                    },
                check:{
                    enable:true,
                    chkStyle:"radio",
                    radioType:"all"
                },
                callback: {
                    onCheck: setParent
                }

            };


            $.fn.zTree.init($("#folderTree"), setting, result.data);
        })


    }
    function setParent(event, treeId, treeNode){
        $("#parentId").val(treeNode.id);
        $("#parentName").val(treeNode.name);
    }
      
    
    
    
</script>
</html>
<!--
/**
 * @ClassName 新增-未定义
 * @Description TODO
 * @Company 会飞的锅工作室
 * @Author yuelh
 * @Email 527083487@qq.com
 * @Date 2020/06/20 11:10:04
 * @Version 1.0
-->